package shuati.nianling;

import javax.swing.plaf.BorderUIResource;
import javax.xml.crypto.Data;
import java.text.SimpleDateFormat;
import java.util.Date;

import static java.lang.Integer.getInteger;

public class Riqi {
    public static void main(String[] args) {
//        Riqi riqi = new Riqi();
//        System.out.println( riqi.dangqian());
//        riqi.ss("张三","1997-06-15");
        int a=11;
        int b=13;
        int c=a>b?b:a;
        System.out.println(c);


    }

    // 获取当前时间
    public String dangqian(){
        Date shijian = new Date();
        SimpleDateFormat dateFormat=new SimpleDateFormat("YYYY年MM月dd日 HH:mm:ss");
        String zuixin = dateFormat.format(shijian);
        return zuixin;

    }


    public static void ss(String name,String ri){
        Date now = new Date();
        SimpleDateFormat dateFormat1 = new SimpleDateFormat("yyyy");
        String nowYear = dateFormat1.format(now);
        String oldYear = ri.substring(0,4);
        int s = Integer.valueOf(nowYear)-Integer.valueOf(oldYear);
        SimpleDateFormat dateFormat2 = new SimpleDateFormat("MMdd");
        String nowRi = dateFormat2.format(now);
        String oldRi = ri.substring(5,10).replace("-","");
        int r = nowRi.compareTo(oldRi);
        if (r<0) {
            System.out.println( name + "今年" +s+"岁!"+"生日还没过!");
        }else {
            System.out.println(name + "今年" + s + "岁!"+"今年生日已过!");
        }
    }

}
